package com.mzj.saas.mservice.bill.repository;

import com.mzj.saas.mservice.bill.entity.HouseExpenseRuleRef;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface HouseExpenseRuleRefRepository   extends PagingAndSortingRepository<HouseExpenseRuleRef, Long>, JpaSpecificationExecutor<HouseExpenseRuleRef>, JpaRepository<HouseExpenseRuleRef,Long> {

    List<HouseExpenseRuleRef> findByHouseId(String houseId);

    List<HouseExpenseRuleRef> findByRuleId(String ruleId);

    HouseExpenseRuleRef findByRuleIdAndHouseId(String ruleId ,String houseId);

    @Transactional
    void deleteByRuleId(String ruleId);

    @Transactional
    void deleteByHouseId(String houseId);


}
